/**
 * 测试运行脚本
 * 
 * 此脚本用于运行所有的持久化功能测试，包括:
 * 1. InMemoryProvider 测试
 * 2. PersistentActor 测试 
 * 3. PersistenceFactory 测试
 */

import { spawnSync } from 'child_process';
import path from 'path';

// 获取项目根目录
const rootDir = path.resolve(__dirname, '../');

console.log('Starting TypeScript persistence tests...');
console.log('=======================================');

// 运行 Jest 测试
const result = spawnSync('npx', ['jest', '--config', 'jest.config.js'], {
  cwd: rootDir,
  stdio: 'inherit',
  shell: true
});

if (result.status === 0) {
  console.log('=======================================');
  console.log('All persistence tests completed successfully!');
} else {
  console.error('=======================================');
  console.error('Some tests failed. See above for details.');
  process.exit(1);
} 